﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="MeetingRequest.aspx.cs" Inherits="RenShiKaoQin.Account.MeetingRequest" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager" runat="server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true">
    </ajaxToolkit:ToolkitScriptManager>
    <div align="center">
    <table border="2" rules="all" cellpadding="5" width="200px"><tr style="font-size:23px;font-weight:bold"><td>个&nbsp;&nbsp;人&nbsp;&nbsp;信&nbsp;&nbsp;息</td></tr></table>
    <table cellpadding="3"><tr align="left"><td>姓名</td><td><asp:Label ID="lbName" runat="server"></asp:Label></td><td>
        性别</td><td>
            <asp:Label ID="lbGender" runat="server"></asp:Label>
        </td><td>出生日期</td><td><asp:Label ID="lbBirthday" runat="server"></asp:Label></td></tr>
    <tr align="left"><td>所属科室</td><td>
        <asp:Label ID="lbInDept" runat="server"></asp:Label>
        </td><td>考勤科室</td>
                <td><asp:Label ID="lbDept" runat="server"></asp:Label></td><td>联系电话</td><td><asp:Label ID="lbTel" runat="server"></asp:Label></td></tr>
                <tr align="left"><td>职称资格</td><td>
                    <asp:Label ID="lbZhiChen" runat="server"></asp:Label>
                    </td><td>聘任岗位</td><td>
                    <asp:Label ID="lbGangWei" runat="server"></asp:Label>
                    </td><td>担任职务</td><td><asp:Label ID="lbHeadShip" runat="server"></asp:Label></td></tr></table>
                    <div style="padding-top:20px">
    <table border="2" rules="all" cellpadding="5" width="200px"><tr style="font-size:23px;font-weight:bold"><td>会&nbsp;&nbsp;议&nbsp;&nbsp;申&nbsp;&nbsp;请</td></tr></table>
    <table cellspacing="0" cellpadding="3" rules="none" border="0" style="border-collapse:collapse;">
        <thead>
        </thead>
        <tbody>
            <tr align="left">
                <td>
                    会议名称
                </td>
                <td>
                    <asp:TextBox ID="tbMemo" runat="server" Width="240px"></asp:TextBox>
                </td>
                <td>会议类别</td><td><asp:DropDownList ID="ddlType" runat="server" DataSourceID="sqlRestType" DataTextField="FName"
                        DataValueField="FKQTypeCode" Width="80px">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="sqlRestType" runat="server" ConnectionString="<%$ ConnectionStrings:hrdbConnectionString %>"
                        
                    
                    
                    SelectCommand="SELECT FKQTypeCode, FName FROM TDictKQType WHERE (FKQTypeCode LIKE '12%') AND (LEN(FKQTypeCode) &gt; 2) OR (FKQTypeCode = '11') UNION ALL SELECT FKQTypeCode, FName FROM TDictKQType AS TDictKQType_1 WHERE (FKQTypeCode = '61') ORDER BY FKQTypeCode DESC"></asp:SqlDataSource></td>
            </tr>
            <tr align="left">
                <td>
                    会议时间
                </td>
                <td>
                    从<asp:TextBox 
                        ID="tbStart" runat="server" Width="90px"></asp:TextBox>
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender1" TargetControlID="tbStart" runat="server"
                        Format="yyyy-MM-dd" DefaultView="Months">
                    </ajaxToolkit:CalendarExtender>
                    至<asp:TextBox ID="tbEnd" runat="server" Width="90px"></asp:TextBox><ajaxToolkit:CalendarExtender
                        ID="CalendarExtender2" TargetControlID="tbEnd" runat="server" Format="yyyy-MM-dd" DefaultView="Months">
                    </ajaxToolkit:CalendarExtender>
                </td>
                <td>会务费</td><td>
                    <asp:TextBox ID="tbMeetingFee" runat="server" Width="75px"></asp:TextBox></td>
                </tr>
                <tr align="left"><td>会议地点</td><td>
                    <asp:TextBox ID="tbLocation" runat="server" Width="240px"></asp:TextBox></td>
                    <td>专业</td><td><asp:TextBox ID="tbZhuanYe" runat="server" Width="75px"></asp:TextBox></td></tr>
                    <tr><td colspan="4">
                    <asp:Button ID="btnApply" runat="server" Text="提交并下载申请单" 
                    onclick="btnApply_Click" BorderStyle="None" Width="100%" Font-Size="18px" />
                        <asp:HiddenField ID="hfAge" runat="server" />
                        </td></tr>
        </tbody>
    </table>
    </div>
    <div style="padding-top:20px">
    <div style="margin-bottom:6px">
    <table border="2" rules="all" cellpadding="5" width="200px"><tr style="font-size:23px;font-weight:bold"><td>申&nbsp;&nbsp;请&nbsp;&nbsp;记&nbsp;&nbsp;录</td></tr></table>
    </div>
    
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Timer ID="Timer1" runat="server" Interval="10000" ontick="Timer1_Tick">
            </asp:Timer>   
    <asp:GridView ID="gvRequest" runat="server" DataSourceID="sqlRestRecord" 
        AutoGenerateColumns="False" DataKeyNames="SerialNO" 
        onrowcommand="gvRequest_RowCommand" onrowdeleting="gvRequest_RowDeleting" 
        CellPadding="4" ForeColor="#333333" GridLines="None" AllowPaging="True" 
                Font-Size="15px">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="StartDate" DataFormatString="{0:yyyy-MM-dd}" 
                HeaderText="开始时间" SortExpression="StartDate" />
            <asp:BoundField DataField="EndDate" DataFormatString="{0:yyyy-MM-dd}" HeaderText="结束时间" 
                SortExpression="EndDate" />
            <asp:BoundField DataField="FName" HeaderText="会议类型" SortExpression="FName" />
            <asp:BoundField DataField="Memo" HeaderText="会议名称" SortExpression="Memo" />
            <asp:BoundField DataField="DeptFName" HeaderText="所在科室" 
                SortExpression="DeptCode" />
            <asp:TemplateField HeaderText="审批状态">
                <ItemTemplate>
                <asp:Label ID="lbExamStatus" runat="server" Text='<%# Eval("ExamStatus").ToString().Equals("True")?"已审批":"未审批" %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="复核状态">
                <ItemTemplate>
                    <asp:Label ID="lbCheckStatus" runat="server" Text='<%# Eval("CheckStatus").ToString().Equals("True")?"已复核":"未复核" %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="拒绝状态">
                <ItemTemplate>
                    <asp:Label ID="lbRejectStatus" runat="server" Text='<%# Eval("RejectStatus").ToString().Equals("True")?"已拒绝":"未拒绝" %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="RejectReason" HeaderText="拒绝原因" 
                SortExpression="RejectReason">
                <ItemStyle Width= "80px" />
            </asp:BoundField>
            <asp:ButtonField HeaderText="撤销" Text="撤销" CommandName="Delete" />
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:SqlDataSource ID="sqlRestRecord" runat="server" 
        ConnectionString="<%$ ConnectionStrings:hrdbConnectionString %>" 
        
    
        
        SelectCommand="SELECT TKQRequestRecord.FEmployeeID, TKQRequestRecord.StartDate, TKQRequestRecord.EndDate, TKQRequestRecord.TypeCode, TKQRequestRecord.Memo, TKQRequestRecord.ExamStatus, TKQRequestRecord.CheckStatus, TKQRequestRecord.SerialNO, TKQRequestRecord.ReadStatus, TKQRequestRecord.DeptCode, TDictKQType.FName, TDictDept.FName AS DeptFName, TKQRequestRecord.RejectStatus, TKQRequestRecord.RejectReason FROM TKQRequestRecord INNER JOIN TDictKQType ON TKQRequestRecord.TypeCode = TDictKQType.FKQTypeCode INNER JOIN TDictDept ON TKQRequestRecord.DeptCode = TDictDept.FDeptCode WHERE (TKQRequestRecord.FEmployeeID = @FEmployeeID) AND (TKQRequestRecord.TypeCode LIKE '12%') AND (LEN(TKQRequestRecord.TypeCode) &gt; 2) OR (TKQRequestRecord.FEmployeeID = @FEmployeeID) AND (TKQRequestRecord.TypeCode = '11') OR (TKQRequestRecord.FEmployeeID = @FEmployeeID) AND (TKQRequestRecord.TypeCode = '61') ORDER BY TKQRequestRecord.StartDate DESC" 
        DeleteCommand="DELETE FROM TKQRequestRecord WHERE (SerialNO = @SerialNO)">
        <DeleteParameters>
            <asp:Parameter Name="SerialNO" />
        </DeleteParameters>
        <SelectParameters>
            <asp:Parameter Name="FEmployeeID" />
        </SelectParameters>
    </asp:SqlDataSource>
    </ContentTemplate>
    </asp:UpdatePanel>
    <div id="PrintArea" class="printdiv" style="display:none">
        <asp:Table ID="tableHolder" runat="server" cellspacing="0" cellpadding="7" rules="all" border="1" style="border-collapse:collapse;" CssClass="holder">
        </asp:Table>
    </div>
    </div>
    </div>
</asp:Content>
